﻿using Serilog;
using WorkflowFramework;

namespace WorkFlowDemo.Steps
{
    public class Step3 : FlowStepBase
    {
        public override string StepName => "Sample Step 3";

        public override async Task<FlowStepResult> ExecuteAsync()
        {
            Log.Information("Executing Step 3...");
            await Task.Delay(400);
            // 模拟随机失败
            if (Random.Shared.Next(0, 10) > 7)
            {
                throw new Exception("Step 3 failed randomly");
            }
            return new FlowStepResult();
        }
    }
}
